'''异常处理'''
def message():
    msg ='''
        '1':test1,
        '2':test2,
        '3':test3
        '''
    print(msg)

chioce_dit={'1':'test1',
            '2':'test2',
            '3':'test3'}

def test1():
    print("运行test1函数")
def test2():
    print("运行test2函数")
def test3():
    print("运行test3函数")


dict1={"1":test1,"2":test2,'3':test3}

message()
while True:
    try:
        choice = input("请选择要运行的函数：").strip()
        dict1[choice]()
        break
    except ValueError as e:
        print(e)
    else:
        print("没有异常的时候执行我")
    finally:
        print("不管有没有异常都执行我")